Skip to content

TEC-56: live-data docking for product-app entry surfaces#21

Merged
imKXNNY merged 2 commits into
mainfrom
feature/tec-56-live-entry-docking
Apr 14, 2026
Merged

TEC-56: live-data docking for product-app entry surfaces#21
imKXNNY merged 2 commits into
mainfrom
feature/tec-56-live-entry-docking

Conversation

@imKXNNY

@imKXNNY imKXNNY commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • dock /provider-profile to live provider detail API flow with explicit loading/error states
  • remove hard-coded provider profile defaults/review fixture dependency and use safe empty-state rendering
  • make marketplace preview invalid payloads return explicit degraded API state instead of silently replacing with local fallback sections
  • align auth/session messaging and session sign-in defaults with API-first behavior
  • update README current-state note for API-backed entry surfaces

Validation

  • pnpm --filter @quickwerk/product-app test
  • pnpm --filter @quickwerk/product-app typecheck
  • pnpm check

Summary by CodeRabbit

  • New Features

    • Provider pages now load live platform data with clear loading, error, and navigation behaviors.
    • Data source labels explicitly show Platform API, loading state, or fallback preview.
  • Bug Fixes / UX

    • Marketplace preview treats invalid payloads as empty/critical and surfaces a clear error message.
    • Provider stats show “N/A” for missing values; recent review section hides when absent.
    • Sign-in preview email removed; auth entry errors display the real error message.
  • Documentation

    • Updated product-facing docs to reflect platform API–first defaults.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 880d4803-57f2-4d9b-81b0-97c2ce0b5662

📥 Commits

Reviewing files that changed from the base of the PR and between a88dc00 and e3add43.

📒 Files selected for processing (2)
  • apps/product-app/src/features/marketplace/marketplace-preview-data.test.ts
  • apps/product-app/src/features/marketplace/marketplace-preview-data.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/product-app/src/features/marketplace/marketplace-preview-data.ts
  • apps/product-app/src/features/marketplace/marketplace-preview-data.test.ts

📝 Walkthrough

Walkthrough

The PR switches the product-facing app to use platform API contracts by default for auth session bootstrap, marketplace preview, provider discovery, and provider profile loading. It replaces several demo/default behaviors with platform-driven flows, adds data-loading and error states for provider profiles, and tightens marketplace preview validation and health signaling.

Changes

Cohort / File(s) Summary
Documentation
README.md
Updated product-facing surfaces text to state platform API contracts are the default; demo/placeholder behavior limited to true request failures and select non-critical UX paths.
Auth & Session
apps/product-app/src/features/auth/auth-action-panel.js, apps/product-app/src/features/auth/auth-entry-section.js, apps/product-app/src/shared/session-bootstrap.ts
Removed hardcoded preview demo email and default demo email from session bootstrap; replaced static demo error text with dynamic authEntryState.errorMessage.
Provider Profile Data Loading
apps/product-app/app/provider-profile.js, apps/product-app/src/features/discovery/provider-detail-actions.ts, apps/product-app/src/features/marketplace/provider-profile-screen.js
Converted ProviderProfile route into a data-loading screen that reads providerUserId, calls loadProviderDetail() (now prefixes requests with platformApiBaseUrl), renders loading/error/data states, and wires navigation callbacks. Refactored provider normalization via createResolvedProvider() and updated ProviderProfile props.
Marketplace Preview
apps/product-app/src/features/marketplace/marketplace-preview-data.ts, apps/product-app/src/features/marketplace/marketplace-preview-data.test.ts, apps/product-app/src/features/marketplace/marketplace-preview-screen.js
Tightened payload validation: treat non-array payload.sections as empty and return an explicit degraded result with critical health and errorMessage (no fallback substitution). Updated derivePreviewHealth for empty sections and adjusted UI to show dynamic errorMessage and explicit data-source labels.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ProviderProfileRoute
    participant useEffect
    participant loadProviderDetail
    participant PlatformAPI
    participant ProviderProfile

    User->>ProviderProfileRoute: Navigate to provider profile
    ProviderProfileRoute->>ProviderProfileRoute: Extract providerUserId from URL params
    ProviderProfileRoute->>useEffect: Trigger on mount/param change
    useEffect->>loadProviderDetail: Call loadProviderDetail(providerUserId)
    ProviderProfileRoute->>ProviderProfile: Render loading spinner

    loadProviderDetail->>PlatformAPI: Fetch using platformApiBaseUrl + path
    alt Success
        PlatformAPI-->>loadProviderDetail: Return provider data
        loadProviderDetail->>ProviderProfileRoute: Return normalized provider
        ProviderProfileRoute->>ProviderProfile: Render with provider data + callbacks
        ProviderProfile->>User: Display profile
    else Missing/Invalid ID or Fetch Error
        loadProviderDetail->>ProviderProfileRoute: Return error state / notFound
        ProviderProfileRoute->>ProviderProfile: Render error view with "Back to discovery"
        ProviderProfile->>User: Display error
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 From demo burrows to platform skies,
I hopped with code and curious eyes.
Now profiles fetch and previews sing,
Real API data—what a spring! 🌱✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: implementing live-data docking for product-app entry surfaces, which is precisely what the changes accomplish across authentication, provider profile, and marketplace preview.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/tec-56-live-entry-docking

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/product-app/src/features/marketplace/marketplace-preview-data.ts (1)

161-178: Avoid hard-coded statusDigest in the empty-state branch.

Line 168 hard-codes a digest format already centralized in buildPreviewStatusDigest; this can drift if the digest schema changes.

♻️ Proposed refactor
   if (sections.length === 0) {
+    const severityBadgeToken = 'badge-critical' as const;
+    const coverageBandToken = 'coverage-low' as const;
+    const alignmentToken = 'align-risk' as const;
     return {
       level: 'critical',
       summary: 'Marketplace preview payload is empty.',
       narrative: 'No valid preview sections were returned by platform-api.',
       riskHeadline: 'Critical risk: preview cannot render customer entry sections from live data.',
-      severityBadgeToken: 'badge-critical',
-      statusDigest: 'critical|badge-critical|coverage-low|align-risk|g0-w0-c0|cw0-cp0-cm0',
-      coverageBandToken: 'coverage-low',
-      alignmentToken: 'align-risk',
+      severityBadgeToken,
+      statusDigest: buildPreviewStatusDigest({
+        level: 'critical',
+        severityBadgeToken,
+        coverageBandToken,
+        alignmentToken,
+        goodSections: 0,
+        watchSections: 0,
+        criticalSections: 0,
+        coverageWellSections: 0,
+        coveragePartialSections: 0,
+        coverageMinimalSections: 0,
+      }),
+      coverageBandToken,
+      alignmentToken,
       criticalSections: 0,
       watchSections: 0,
       goodSections: 0,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/product-app/src/features/marketplace/marketplace-preview-data.ts` around
lines 161 - 178, The empty-state branch currently returns a hard-coded
statusDigest string; replace that hard-coded value by calling the centralized
buildPreviewStatusDigest(...) function so the digest stays consistent with the
rest of the module. In the return object for the sections.length === 0 case,
keep the existing tokens (severityBadgeToken, coverageBandToken, alignmentToken,
and other flags/counts) but compute statusDigest by invoking
buildPreviewStatusDigest with the same tokens/flags used elsewhere (e.g.,
severityBadgeToken, coverageBandToken, alignmentToken, critical/watch/good
counts or coverage flags) instead of the literal 'critical|badge-critical|...'.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/product-app/src/features/marketplace/marketplace-preview-data.ts`:
- Around line 446-453: The code must guard against non-array payload.sections
before mapping; change the logic that computes sections to use
Array.isArray(payload.sections) — if true, map payload.sections to the existing
section shape, otherwise set sections = [] — so the subsequent check (if
(sections.length === 0) { return { sections: [], previewHealth:
derivePreviewHealth([]), source: 'platform-api', errorMessage: ... } }) will run
instead of throwing; update any code paths that assume payload.sections is an
array (referencing payload.sections, sections, and derivePreviewHealth) and add
unit tests that send malformed payload.sections values (object, string, number,
null) to verify the degraded 'platform-api' response is returned rather than
throwing.

---

Nitpick comments:
In `@apps/product-app/src/features/marketplace/marketplace-preview-data.ts`:
- Around line 161-178: The empty-state branch currently returns a hard-coded
statusDigest string; replace that hard-coded value by calling the centralized
buildPreviewStatusDigest(...) function so the digest stays consistent with the
rest of the module. In the return object for the sections.length === 0 case,
keep the existing tokens (severityBadgeToken, coverageBandToken, alignmentToken,
and other flags/counts) but compute statusDigest by invoking
buildPreviewStatusDigest with the same tokens/flags used elsewhere (e.g.,
severityBadgeToken, coverageBandToken, alignmentToken, critical/watch/good
counts or coverage flags) instead of the literal 'critical|badge-critical|...'.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9f501b7b-d4e7-4e3b-a94c-05e18b5619cb

📥 Commits

Reviewing files that changed from the base of the PR and between 7d0ace4 and a88dc00.

📒 Files selected for processing (10)
  • README.md
  • apps/product-app/app/provider-profile.js
  • apps/product-app/src/features/auth/auth-action-panel.js
  • apps/product-app/src/features/auth/auth-entry-section.js
  • apps/product-app/src/features/discovery/provider-detail-actions.ts
  • apps/product-app/src/features/marketplace/marketplace-preview-data.test.ts
  • apps/product-app/src/features/marketplace/marketplace-preview-data.ts
  • apps/product-app/src/features/marketplace/marketplace-preview-screen.js
  • apps/product-app/src/features/marketplace/provider-profile-screen.js
  • apps/product-app/src/shared/session-bootstrap.ts

@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 2 file(s) based on 1 unresolved review comment.

Files modified:

  • apps/product-app/src/features/marketplace/marketplace-preview-data.test.ts
  • apps/product-app/src/features/marketplace/marketplace-preview-data.ts

Commit: e3add43437ee0f634a4cc54657184622accb420c

The changes have been pushed to the feature/tec-56-live-entry-docking branch.

Time taken: 4m 59s

Fixed 2 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@imKXNNY imKXNNY merged commit 516b6e0 into main Apr 14, 2026
2 checks passed
@imKXNNY imKXNNY deleted the feature/tec-56-live-entry-docking branch April 14, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant